package com.wangshouyu.mp.menu;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月06日 22:22:43
 * @description: 匹配规则
 */
public class MatchRule implements Serializable {

    /**
     * 用户标签的id
     */
    @SerializedName(value = "tag_id")
    @JsonProperty(value = "tag_id")
    @JSONField(name = "tag_id")
    private String tagId;

    /**
     * 用户标签的id
     */
    @SerializedName(value = "group_id")
    @JsonProperty(value = "group_id")
    @JSONField(name = "group_id")
    private String groupId;

    /**
     * 性别：男（1）女（2）
     */
    private String sex;

    /**
     * 国家信息
     */
    private String country;

    /**
     * 省份信息
     */
    private String province;

    /**
     * 城市信息
     */
    private String city;

    /**
     * 客户端版本
     */
    @SerializedName(value = "client_platform_type")
    @JsonProperty(value = "client_platform_type")
    @JSONField(name = "client_platform_type")
    private String clientPlatformType;

    /**
     * 语言信息
     */
    private String language;

    public String getTagId() {
        return tagId;
    }

    public void setTagId(String tagId) {
        this.tagId = tagId;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getClientPlatformType() {
        return clientPlatformType;
    }

    public void setClientPlatformType(String clientPlatformType) {
        this.clientPlatformType = clientPlatformType;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MatchRule matchRule = (MatchRule) o;
        return Objects.equals(tagId, matchRule.tagId) && Objects.equals(groupId, matchRule.groupId) && Objects.equals(sex, matchRule.sex) && Objects.equals(country, matchRule.country) && Objects.equals(province, matchRule.province) && Objects.equals(city, matchRule.city) && Objects.equals(clientPlatformType, matchRule.clientPlatformType) && Objects.equals(language, matchRule.language);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tagId, groupId, sex, country, province, city, clientPlatformType, language);
    }

    @Override
    public String toString() {
        return "MatchRule{" +
                "tagId='" + tagId + '\'' +
                ", groupId='" + groupId + '\'' +
                ", sex='" + sex + '\'' +
                ", country='" + country + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", clientPlatformType='" + clientPlatformType + '\'' +
                ", language='" + language + '\'' +
                '}';
    }
}
